var express = require('express')
var app = express()

app.get('/users/:userId/books/:bookId',function (req , res) {
    res.send(req.params)
    console.log();
})

app.get('/flights/:frome-:to' , function (req , res ,next) {
    res.send(req.params)
    console.log(req.params)
    next()
} , function (req , res , next) {

    // res.send('this next ')
    console.log('this next')
    next()
} , function (req , res , next) {
    console.log('this next2');
})

app.post('/' , function (req, res) {
    res.send('post')
})
app.delete('/' , function (req, res) {
    res.send('delete')
})

app.put('/' , function (req , res) {
    res.send('put')
})

app.listen(3000 , function (err) {
    if (err) {
        console.error(err.stack)
    }
    console.log( "listen port 3000")
})
